// components/WeatherCard/WeatherCard.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        weatherindices:{
            type:Object
        },
        location:{
            type:String
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
           cardindices:[],
           Location:''
    },
    observers:{
        'weatherindices':function(val){
           if(val.code!=undefined){
              this.weathercard(val)
           }
        },
        'location':function(val){
            if(val!=''){
             this.setData({
                 Location:val
             })
            }
        }
    },

    /**
     * 组件的方法列表
     */
    methods: {
        weathercard(val){
            this.setData({
                cardindices:val.daily
            })
        },
        morecard(){
            wx.navigateTo({
                url: '../../pages/indexlist/morecard/index?location='+this.data.Location,
            })
        }
    }
})
